<?php

namespace App\Containers\AppSection\Qualification\Actions;

use App\Containers\AppSection\Qualification\Tasks\CreateRemarkTask;
use App\Containers\AppSection\Qualification\Tasks\FindQualificationByIdTask;
use App\Ship\Parents\Actions\Action;
use App\Ship\Parents\Requests\Request;

class ModeratorAddRemarkAction extends Action
{

    public function run(Request $request)
    {
        $qualification = app(FindQualificationByIdTask::class)->run($request->getInputByKey('qualification_id'));

        return app(CreateRemarkTask::class)->run([
            'message' => $request->getInputByKey('remark'),
            'qualification_id' => $qualification->id,
            'profile_id' => $request->profile()->id
        ]);
    }
}
